package com.cat.dataStructure03;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/count-all-valid-pickup-and-delivery-options/
 * @create 2025/11/16 16:22
 * @since JDK17
 */

public class Solution71 {
    public int countOrders(int n) {
        int N = ((int) 1e9) + 7;
        long pre = 1, cur = 1;
        for (int i = 2; i <= n; i++) {
            cur = pre * (2 * i - 1) * i % N;
            pre = cur;
        }

        return (int)cur;
    }
}
